home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / ObjectTcl-1.1 / mkdirs < prev    next >
Encoding:
Text File  |  1995-06-30  |  559 b   |  36 lines

  1. #!/bin/sh
  2.  
  3. #
  4. # Validate arguments
  5. #
  6. if [ $# != 1 ]
  7. then
  8.     echo "usage: $0 dirname" >&2
  9.     exit 1
  10. fi
  11.  
  12. #
  13. # If this isn't an absolute path, initialize the directory path to the 
  14. # current directory.
  15. #
  16. case $1 in 
  17.    /*) dirpath=""
  18.        ;;
  19.     *) dirpath="."
  20.        ;;
  21. esac
  22.  
  23. #
  24. # Loop through building non-existant directories.
  25. #
  26. for dir in `echo $1 | sed -e 's@/@ @g'`
  27. do
  28.     dirpath="$dirpath/$dir"
  29.     if [ ! -x $dirpath ]
  30.     then
  31.         echo "Making directory $dirpath"
  32.         mkdir $dirpath || exit 1
  33.         chmod 755  $dirpath || exit 1
  34.     fi
  35. done
  36.